from django.urls import path, re_path, include
from . import views

app_name = 'users'

urlpatterns = [
    path('register/', views.RegisterView.as_view(), name='register'),
    re_path('usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/', views.UsernameCountView.as_view()),
    re_path(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/', views.MobileCountView.as_view()),
    path('login/', views.LoginView.as_view(), name='login'),
    path('logout/', views.LogoutView.as_view(), name='logout'),
    path('info/', views.UserInfoView.as_view(), name='info'),
    path('emails/', views.EmailView.as_view()),
    path('emails/verification/', views.VerifyEmailView.as_view()),
    path('addresses/', views.AddressView.as_view(), name='address'),
    path('addresses/create/', views.AddressCreateView.as_view()),
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),

    path('addresses/<int:address_id>/title/', views.UpdateTitleAddressView.as_view()),
    path('addresses/<int:address_id>/', views.UpdateDestroyAddressView.as_view()),
    path('resetpasswd/', views.ResetPasswordView.as_view(), name='resetpwd'),

    path('browse_histories/', views.UserBorwseHistory.as_view()),

    path('orders/info/<int:page_num>/', views.UserOrderInfoView.as_view(), name='myorderinfo'),

]
